package xyz.zhouzhaodong.crm.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zhouzhaodong.crm.dto.AdmissionDto;
import xyz.zhouzhaodong.crm.service.IAdmissionService;
import xyz.zhouzhaodong.crm.util.NoRepeatSubmit;
import xyz.zhouzhaodong.crm.util.RestMessage;

import javax.annotation.Resource;

/**
 * <p>
 * 录取表 前端控制器
 * </p>
 *
 * @author zhouzhaodong
 * @since 2020-06-19
 */
@RestController
@RequestMapping("/admission")
public class AdmissionController {

    @Resource
    IAdmissionService admissionService;

    /**
     * 新增录取信息
     * @param admissionDto
     * @return
     */
    @NoRepeatSubmit
    @RequestMapping("/add")
    public RestMessage addAdmission(AdmissionDto admissionDto){
        return admissionService.addAdmission(admissionDto);
    }

    /**
     * 删除录取信息
     * @param admissionDto
     * @return
     */
    @RequestMapping("/delete")
    public RestMessage deleteAdmission(AdmissionDto admissionDto){
        return admissionService.deleteAdmission(admissionDto);
    }

    /**
     * 修改录取信息
     * @param admissionDto
     * @return
     */
    @RequestMapping("/update")
    public RestMessage updateAdmission(AdmissionDto admissionDto){
        return admissionService.updateAdmission(admissionDto);
    }

    /**
     * 查询录取信息
     * @param admissionDto
     * @return
     */
    @RequestMapping("/select")
    public RestMessage selectAdmission(AdmissionDto admissionDto){
        return admissionService.selectAdmission(admissionDto);
    }

    /**
     * 根据用户id查询录取信息
     * @param admissionDto
     * @return
     */
    @RequestMapping("/selectList")
    public RestMessage selectAdmissionList(AdmissionDto admissionDto){
        return admissionService.selectAdmissionList(admissionDto);
    }

}
